package com.myway.dto.ticket;

import com.myway.dto.order.DTOIllnessAnnex;
import com.myway.dto.payment.DTOPayment;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @类名称：DTOFltRefund 
 * @类描述：退票（款） 
 * @创建时间：2015年11月11日 下午7:56:22 
 * @author Jiang.Yida
 * @version V1.0
 */
public class DTOFltRefund implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7744046230437330313L;
	private Long id;
	private Long orderId;
	private String refundNo;
	private String userName;
	private Date createTime;
	/**
	 * status: FIRSTAUDIT=一审	
	 * 				FPASS=一审通过
	 * 				FREJECT 一审拒绝
	 * 				SECONDAUDIT=二审
	 * 				PASS=二审通过
	 *  			REJECT =二审拒绝
	 *  			PAID=已退款
	 *  			FAIL=退款失败 
	 *  			PEND=挂起/悬挂 系统处理中，等待结果
	 */
	private String status;//状态
	private String remark; //退票申请备注

	private String payMode;//退款方式（线上：online 线下:offline）

	private Date payTime;//退款时间
	private String airlineCode; //航司代码
	/**
	   INTRADAY=当日作废
		UNCONSTRAINT=自愿退票
		CONSTRAINT=非自愿退票
		ILLNESS因病退票
		IRREGULAR非正常航班
		PAYNOTKT异常退票(已支付未出票)
		MISSPAY差错退票(支付掉单)
		REPAIR线上补退
	 */
	private String refundType;//退票类型(当日作废、自愿退票、非自愿退票)
	private String officeNo;
	private boolean rejected = false;

	private List<DTOFltRefundPaxSeg> fltRefundPaxSegList = new ArrayList<DTOFltRefundPaxSeg>();

	private List<DTOPayment> payments=new ArrayList<DTOPayment>();
//	
//	private List<DTOLmkFreeTicket> dtoFreeTickets = new ArrayList<DTOLmkFreeTicket>();
//	
//	private List<DtoLmkPointRecord> dtoPoints = new ArrayList<DtoLmkPointRecord>();
	//是否退还免票

	private String refundFT;
	//是否退还积分

	private String refundPoint;
	/**
	 * 退票人
	 */
	private String refundUser ;
	/**
	 * 退款时间

	 */
	private Date refundTime;
	/*
	 * 用户类型
	 */
	private String userType;
	/*
	 * 订单来源
	 */
	private String orderSource;
	
	private List<DTOIllnessAnnex> illnessAnnexs = new ArrayList<DTOIllnessAnnex>();//病退上传附件集合
	
	///////////////方便查看退款信息//////////////////////机建、舱位、票面价、实售价、申请退款、实际退款、手续费
	//燃油
	private double fareRefundAmount = 0;
	//机建
	private double airportTaxRefundAmount = 0;
	//舱位
	private String cabinRefund = "";
	//票面价

	private double ticketSaleAmount = 0;
	//实售价

	private double actualSaleAmount = 0;
	//申请退款

	private double applyRefundAmount = 0;
	//实际退款

	private double actualRefundAmount = 0;
	//手续费

	private double processFeeAmount = 0; 
	//是否多人退款

	private String morePeople = "NO";
	
	private Date retrieveTime;//清位时间
	
	//升舱改期单ID
	private Long changeId;
	//补购单ID
	private Long orderExtId;
	
	private int retrieveTimeFlag= 0;//获取清位时间是否正常标识符，0为正常，1为异常
	
	private String bankName;//开户行
	private String bankAccountName;//开户名
	private String bankAccountNo;//账号
	
	//优惠券号码
	private String couponNo;
	private String couponType;//优惠券类型
	
	//西部支付处理费标记
	boolean refundALL = false;

	
	public boolean isRefundALL() {
		return refundALL;
	}

	public void setRefundALL(boolean refundALL) {
		this.refundALL = refundALL;
	}

	public int getRetrieveTimeFlag() {
		return retrieveTimeFlag;
	}

	public void setRetrieveTimeFlag(int retrieveTimeFlag) {
		this.retrieveTimeFlag = retrieveTimeFlag;
	}

	public DTOFltRefund() {

	}

	public DTOFltRefund(Long orderId, String userName) {
		this.orderId = orderId;
		this.userName = userName;
		this.createTime = new Date();
		this.status = "NEW";
	}

	@Override
	protected void finalize() throws Throwable {
		super.finalize();
	}

	public Long getId() {
		return id;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setId(Long newVal) {
		id = newVal;
	}

	public Long getOrderId() {
		return orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	public String getRefundNo() {
		return refundNo;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setRefundNo(String newVal) {
		refundNo = newVal;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setCreateTime(Date newVal) {
		createTime = newVal;
	}

	public String getStatus() {
		return status;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setStatus(String newVal) {
		status = newVal;
	}

	public List<DTOFltRefundPaxSeg> getFltRefundPaxSegList() {
		return fltRefundPaxSegList;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setFltRefundPaxSegList(List<DTOFltRefundPaxSeg> newVal) {
		fltRefundPaxSegList = newVal;
	}

	public boolean isRejected() {
		return rejected;
	}

	/**
	 * Reject the refund
	 */
	public void reject() {
		this.rejected = true;
	}
	
	/**
	 * Allow the refund
	 */
	public void allow() {
		this.rejected = false;
	}
	
	/**
	 * Get total refund amount.
	 * 
	 * @return
	 */
	public double getTotalRefundAmount() {
		double amount = 0.0;
		for (DTOFltRefundPaxSeg frps : fltRefundPaxSegList) {
			amount += frps.getRefundAmount();
		}
		return amount;
	}
	
	/**
	 * @return the remark
	 */
	public String getRemark()
	{
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark)
	{
		this.remark = remark;
	}

	/**
	 * @return the payMode
	 */
	public String getPayMode()
	{
		return payMode;
	}

	/**
	 * @param payMode the payMode to set
	 */
	public void setPayMode(String payMode)
	{
		this.payMode = payMode;
	}

	/**
	 * @return the payTime
	 */
	public Date getPayTime()
	{
		return payTime;
	}

	/**
	 * @param payTime the payTime to set
	 */
	public void setPayTime(Date payTime)
	{
		this.payTime = payTime;
	}

	public String getAirlineCode() {
		return airlineCode;
	}

	public void setAirlineCode(String airlineCode) {
		this.airlineCode = airlineCode;
	}

	/**
	 * Get total actual refund amount.
	 * 
	 * @return
	 */
	public double getTotalActualRefundAmount() {
		double amount = 0.0;
		for (DTOFltRefundPaxSeg frps : fltRefundPaxSegList) {
			amount += frps.getActualRefundAmount();
		}
		return amount;
	}

	/**
	 * @return the refundType
	 */
	public String getRefundType()
	{
		return refundType;
	}

	/**
	 * @param refundType the refundType to set
	 */
	public void setRefundType(String refundType)
	{
		this.refundType = refundType;
	}

	/**
	 * @return the officeNo
	 */
	public String getOfficeNo()
	{
		return officeNo;
	}

	/**
	 * @param officeNo the officeNo to set
	 */
	public void setOfficeNo(String officeNo)
	{
		this.officeNo = officeNo;
	}

	
	/**
	 * @return the payments
	 */
	public List<DTOPayment> getPayments()
	{
		return payments;
	}

	
	/**
	 * @param payments the payments to set
	 */
	public void setPayments(List<DTOPayment> payments)
	{
		this.payments = payments;
	}

	public String getRefundUser() {
		return refundUser;
	}

	public void setRefundUser(String refundUser) {
		this.refundUser = refundUser;
	}

	public Date getRefundTime() {
		return refundTime;
	}

	public void setRefundTime(Date refundTime) {
		this.refundTime = refundTime;
	}

	
	/**
	 * @return the fareRefundAmount
	 */
	public double getFareRefundAmount()
	{
		return fareRefundAmount;
	}

	
	/**
	 * @param fareRefundAmount the fareRefundAmount to set
	 */
	public void setFareRefundAmount(double fareRefundAmount)
	{
		this.fareRefundAmount = fareRefundAmount;
	}

	
	/**
	 * @return the airportTaxRefundAmount
	 */
	public double getAirportTaxRefundAmount()
	{
		return airportTaxRefundAmount;
	}

	
	/**
	 * @param airportTaxRefundAmount the airportTaxRefundAmount to set
	 */
	public void setAirportTaxRefundAmount(double airportTaxRefundAmount)
	{
		this.airportTaxRefundAmount = airportTaxRefundAmount;
	}

	
	/**
	 * @return the cabinRefund
	 */
	public String getCabinRefund()
	{
		return cabinRefund;
	}

	
	/**
	 * @param cabinRefund the cabinRefund to set
	 */
	public void setCabinRefund(String cabinRefund)
	{
		this.cabinRefund = cabinRefund;
	}

	
	/**
	 * @return the ticketSaleAmount
	 */
	public double getTicketSaleAmount()
	{
		return ticketSaleAmount;
	}

	
	/**
	 * @param ticketSaleAmount the ticketSaleAmount to set
	 */
	public void setTicketSaleAmount(double ticketSaleAmount)
	{
		this.ticketSaleAmount = ticketSaleAmount;
	}

	
	/**
	 * @return the actualSaleAmount
	 */
	public double getActualSaleAmount()
	{
		return actualSaleAmount;
	}

	
	/**
	 * @param actualSaleAmount the actualSaleAmount to set
	 */
	public void setActualSaleAmount(double actualSaleAmount)
	{
		this.actualSaleAmount = actualSaleAmount;
	}

	
	/**
	 * @return the applyRefundAmount
	 */
	public double getApplyRefundAmount()
	{
		return applyRefundAmount;
	}

	
	/**
	 * @param applyRefundAmount the applyRefundAmount to set
	 */
	public void setApplyRefundAmount(double applyRefundAmount)
	{
		this.applyRefundAmount = applyRefundAmount;
	}

	
	/**
	 * @return the actualRefundAmount
	 */
	public double getActualRefundAmount()
	{
		return actualRefundAmount;
	}

	
	/**
	 * @param actualRefundAmount the actualRefundAmount to set
	 */
	public void setActualRefundAmount(double actualRefundAmount)
	{
		this.actualRefundAmount = actualRefundAmount;
	}

	
	/**
	 * @return the processFeeAmount
	 */
	public double getProcessFeeAmount()
	{
		return processFeeAmount;
	}

	
	/**
	 * @param processFeeAmount the processFeeAmount to set
	 */
	public void setProcessFeeAmount(double processFeeAmount)
	{
		this.processFeeAmount = processFeeAmount;
	}

	
	/**
	 * @return the morePeople
	 */
	public String getMorePeople()
	{
		return morePeople;
	}

	
	/**
	 * @param morePeople the morePeople to set
	 */
	public void setMorePeople(String morePeople)
	{
		this.morePeople = morePeople;
	}

	/**
	 * @return the refundFT
	 */
	public String getRefundFT()
	{
		return refundFT;
	}

	/**
	 * @param refundFT the refundFT to set
	 */
	public void setRefundFT(String refundFT)
	{
		this.refundFT = refundFT;
	}

	/**
	 * @return the refundPoint
	 */
	public String getRefundPoint()
	{
		return refundPoint;
	}

	/**
	 * @param refundPoint the refundPoint to set
	 */
	public void setRefundPoint(String refundPoint)
	{
		this.refundPoint = refundPoint;
	}

	/**
	 * @return the dtoFreeTickets
	 */
//	public List<DTOLmkFreeTicket> getDtoFreeTickets()
//	{
//		return dtoFreeTickets;
//	}
//
//	/**
//	 * @param dtoFreeTickets the dtoFreeTickets to set
//	 */
//	public void setDtoFreeTickets(List<DTOLmkFreeTicket> dtoFreeTickets)
//	{
//		this.dtoFreeTickets = dtoFreeTickets;
//	}
//
//	/**
//	 * @return the dtoPoints
//	 */
//	public List<DtoLmkPointRecord> getDtoPoints()
//	{
//		return dtoPoints;
//	}
//
//	/**
//	 * @param dtoPoints the dtoPoints to set
//	 */
//	public void setDtoPoints(List<DtoLmkPointRecord> dtoPoints)
//	{
//		this.dtoPoints = dtoPoints;
//	}


	public Date getRetrieveTime() {
		return retrieveTime;
	}

	public void setRetrieveTime(Date retrieveTime) {
		this.retrieveTime = retrieveTime;
	}

	/*
	 * return the userType
	 */
	public String getUserType() {
		return userType;
	}

	/**
	 * @param userType the userType to set
	 */
	public void setUserType(String userType) {
		this.userType = userType;
	}

	/*
	 * return the orderSource
	 */
	public String getOrderSource() {
		return orderSource;
	}

	/**
	 * @param orderSource the orderSource to set
	 */
	public void setOrderSource(String orderSource) {
		this.orderSource = orderSource;
	}

	/**
	 * @return the changeId
	 */
	public Long getChangeId() {
		return changeId;
	}

	/**
	 * @param changeId the changeId to set
	 */
	public void setChangeId(Long changeId) {
		this.changeId = changeId;
	}

	/**
	 * 优惠券号
	 * @return
	 */
	public String getCouponNo() {
		return couponNo;
	}


	public void setCouponNo(String couponNo) {
		this.couponNo = couponNo;
	}

	/**
	 * 	
	 * 优惠券类型
	 * @return
	 */
	public String getCouponType() {
		return couponType;
	}

	public void setCouponType(String couponType) {
		this.couponType = couponType;
	}

	public List<DTOIllnessAnnex> getIllnessAnnexs() {
		return illnessAnnexs;
	}

	public void setIllnessAnnexs(List<DTOIllnessAnnex> illnessAnnexs) {
		this.illnessAnnexs = illnessAnnexs;
	}

	public void setRejected(boolean rejected) {
		this.rejected = rejected;
	}

	public Long getOrderExtId() {
		return orderExtId;
	}

	public void setOrderExtId(Long orderExtId) {
		this.orderExtId = orderExtId;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBankAccountName() {
		return bankAccountName;
	}

	public void setBankAccountName(String bankAccountName) {
		this.bankAccountName = bankAccountName;
	}

	public String getBankAccountNo() {
		return bankAccountNo;
	}

	public void setBankAccountNo(String bankAccountNo) {
		this.bankAccountNo = bankAccountNo;
	}
	
}